<?php
/*
 * Administrator Controller
 * 
 * this file fills the template with data
 * 
 * @author : Jason Meulenhoff
 * @mail : mail@kacangboi.com
 * @web : http://kacangboi.com
 * @copyright : KacangNetworks 2010
 * 
 */
require_once ("../../config.php");

/* Security Admin */
if(isset($_SESSION['admin']) && isLogged())
{}
else
	header("Location: error.controller.php");


if(isBreadCrumbSessionSet())
		addToList(getCurrentPage());
try
{
	$parser = new parser();
	$parser->loadTemplate("../templates/admin.html");
	
	if(DISPLAY_FLOAT)
	{
		$parser->assignVar("script","<script type=\"text/javascript\" src=\"../js/floatingbar.js\"></script>");
		$parser->assignVar("message","<img src='error.png'/> Application running in Development Mode");
	}
	else
	{
		$parser->assignVar("script",""); 
	}
		
	$parser->assignVar("title",PAGE_TITLE);
	$parser->assignVar("breadcrumb",displayBreadCrumb());
	$parser->assignVar("menu",generateMenu());
	$parser->assignVar("username","{$_SESSION['logged']['name']}");
	$parser->assignVar("userDetails",strtolower(PORTAL_NAME.date('dm')));
	$parser->assignVar("passwordDetails",generatePassword());
	$parser->assignVar("data",PORTAL_NAME."_P");
	$parser->parse(true);
	
}catch(Exception $e)
{
	echo $e->getMessage();
}

?>